home *** CD-ROM | disk | FTP | other *** search
/ com!online 2005 May / com_0505_1.iso / opensource / top10 / amc_install.exe / {app} / Scripts / videoteka.com.pl.ifs < prev    next >
Encoding:
Text File  |  2004-11-12  |  22.0 KB  |  594 lines

  1. // GETINFO SCRIPTING
  2. // www.videoteka.com.pl/ info & picture, by Goster
  3.  
  4. (***********************************************
  5.  *   Movie information & picture importation        *
  6.  *    script for http://www.videoteka.com.pl/        *
  7.  *           (c) 2004 Goster                                     *
  8.  *                                                                   *
  9.  *      partialy based on Film.WP (PL) by îwistak    *    
  10.  *                                                                    *
  11.  *                                                                   *
  12.  *  For use with Ant Movie Catalog 3.4.3              *
  13.  *  www.antp.be/software/moviecatalog                *
  14.  *                                                                   *
  15.  *  This program is free software; you can           *
  16.  *  redistribute it and/or modify it under the       *
  17.  *  terms of the GNU General Public License as    *
  18.  *  published by the Free Software Foundation;     *
  19.  *  either version 2 of the License, or (at your     *
  20.  *  option) any later version.                              *
  21.  ***********************************************)
  22.  
  23. program Casablanca;
  24. var
  25.   MovieName, temp: string;
  26.   Link: string;
  27.   jakitytul: boolean;
  28.   PHPSESSID: string;
  29.   pozycja, pozycja2: integer;
  30.   PHPsessidTablica: Array Of String;
  31.   cover, nocover: boolean;
  32.  
  33. function FindLine(Pattern: string; List: TStringList; StartAt: Integer): Integer;
  34.   var
  35.   i: Integer;
  36.   begin
  37.   result := -1;
  38.   if StartAt < 0 then
  39.     StartAt := 0;
  40.   for i := StartAt to List.Count-1 do
  41.     if Pos(Pattern, List.GetString(i)) <> 0 then
  42.       begin
  43.       result := i;
  44.       Break;
  45.       end;
  46.   end;
  47.  
  48. procedure DecodeHTML(var Value: String);
  49.   var
  50.   FullValue, CharCode: String;
  51.   Counter: Integer;
  52.   begin
  53.   if Value <> '' then begin
  54.     FullValue := '';
  55.     Counter := 1;
  56.     repeat
  57.       if StrGet(Value, Counter) <> '&' then
  58.         begin
  59.         CharCode := copy(Value, Counter, 1);
  60.         case CharCode of
  61.           '▒': CharCode := '╣';
  62.           '╢': CharCode := '£';
  63.           'í': CharCode := 'Ñ';
  64.           '╝': CharCode := 'ƒ';
  65.           'ª': CharCode := 'î';
  66.           '¼': CharCode := 'Å';
  67.           end;
  68.         FullValue := FullValue + CharCode;
  69.         Counter := Counter + 1;
  70.         end
  71.       else
  72.         begin
  73.         CharCode := copy(Value, Counter, 7);
  74.         case CharCode of
  75.           'ą': FullValue := FullValue + '╣';
  76.           'ć': FullValue := FullValue + 'µ';
  77.           'ę': FullValue := FullValue + 'Ω';
  78.           'ł': FullValue := FullValue + '│';
  79.           'ń': FullValue := FullValue + '±';
  80.           'ó': FullValue := FullValue + '≤';
  81.           'ś': FullValue := FullValue + '£';
  82.           'ź': FullValue := FullValue + 'ƒ';
  83.           'ż': FullValue := FullValue + '┐';
  84.           'Ą': FullValue := FullValue + 'Ñ';
  85.           'Ć': FullValue := FullValue + '╞';
  86.           'Ę': FullValue := FullValue + '╩';
  87.           'Ł': FullValue := FullValue + 'ú';
  88.           'Ń': FullValue := FullValue + '╤';
  89.           'Ó': FullValue := FullValue + '╙';
  90.           'Ś': FullValue := FullValue + 'î';
  91.           'Ź': FullValue := FullValue + 'Å';
  92.           'Ż': FullValue := FullValue + '»';
  93.           'Š': FullValue := FullValue + ' ';
  94.           'š': FullValue := FullValue + 'í';
  95.           'Ţ': FullValue := FullValue + 'í';
  96.           'ţ': FullValue := FullValue + 'ú';
  97.           'Ť': FullValue := FullValue + 'ñ';
  98.           'ť': FullValue := FullValue + 'Ñ';
  99.           'Ŧ': FullValue := FullValue + 'î';
  100.           'ŧ': FullValue := FullValue + 'º';
  101.           'Ũ': FullValue := FullValue + '¿';
  102.           'ũ': FullValue := FullValue + '⌐';
  103.           'Ű': FullValue := FullValue + '¬';
  104.           'ű': FullValue := FullValue + '½';
  105.           'Ų': FullValue := FullValue + '¼';
  106.           'ų': FullValue := FullValue + '¡';
  107.           'Ŵ': FullValue := FullValue + '«';
  108.           'ŵ': FullValue := FullValue + '»';
  109.           'Ŷ': FullValue := FullValue + '░';
  110.           'ŷ': FullValue := FullValue + '▒';
  111.           'Ÿ': FullValue := FullValue + '▓';
  112.           'ƀ': FullValue := FullValue + '┤';
  113.           'Ɓ': FullValue := FullValue + '╡';
  114.           'Ƃ': FullValue := FullValue + '╢';
  115.           'ƃ': FullValue := FullValue + '╖';
  116.           'Ƅ': FullValue := FullValue + '╕';
  117.           'ƅ': FullValue := FullValue + '╣';
  118.           'Ɔ': FullValue := FullValue + '║';
  119.           'Ƈ': FullValue := FullValue + '╗';
  120.           'ƈ': FullValue := FullValue + '╝';
  121.           'Ɖ': FullValue := FullValue + '╜';
  122.           'Ɛ': FullValue := FullValue + '╛';
  123.           'Ƒ': FullValue := FullValue + '┐';
  124.           'ƒ': FullValue := FullValue + '└';
  125.           'Ɠ': FullValue := FullValue + '┴';
  126.           'Ɣ': FullValue := FullValue + '┬';
  127.           'ƕ': FullValue := FullValue + '├';
  128.           'Ɩ': FullValue := FullValue + '─';
  129.           'Ɨ': FullValue := FullValue + '┼';
  130.           'Ƙ': FullValue := FullValue + '╞';
  131.           'ƙ': FullValue := FullValue + '╟';
  132.           'Ȁ': FullValue := FullValue + '╚';
  133.           'ȁ': FullValue := FullValue + '╔';
  134.           'Ȃ': FullValue := FullValue + '╩';
  135.           'ȃ': FullValue := FullValue + '╦';
  136.           'Ȅ': FullValue := FullValue + '╠';
  137.           'ȅ': FullValue := FullValue + '═';
  138.           'Ȇ': FullValue := FullValue + '╬';
  139.           'ȇ': FullValue := FullValue + '╧';
  140.           'Ȉ': FullValue := FullValue + '╨';
  141.           'ȉ': FullValue := FullValue + '╤';
  142.           'Ȑ': FullValue := FullValue + '╥';
  143.           'ȑ': FullValue := FullValue + '╙';
  144.           'Ȓ': FullValue := FullValue + '╘';
  145.           'ȓ': FullValue := FullValue + '╒';
  146.           'Ȕ': FullValue := FullValue + '╓';
  147.           'ȕ': FullValue := FullValue + '╫';
  148.           'Ȗ': FullValue := FullValue + '╪';
  149.           'ȗ': FullValue := FullValue + '┘';
  150.           'Ș': FullValue := FullValue + '┌';
  151.           'ș': FullValue := FullValue + '█';
  152.           'Ƞ': FullValue := FullValue + '▄';
  153.           'ȡ': FullValue := FullValue + '▌';
  154.           'Ȣ': FullValue := FullValue + '▐';
  155.           'ȣ': FullValue := FullValue + '▀';
  156.           'Ȥ': FullValue := FullValue + 'α';
  157.           'ȥ': FullValue := FullValue + 'ß';
  158.           'Ȧ': FullValue := FullValue + 'Γ';
  159.           'ȧ': FullValue := FullValue + 'π';
  160.           'Ȩ': FullValue := FullValue + 'Σ';
  161.           'ȩ': FullValue := FullValue + 'σ';
  162.           'Ȱ': FullValue := FullValue + 'µ';
  163.           'ȱ': FullValue := FullValue + 'τ';
  164.           'Ȳ': FullValue := FullValue + 'Φ';
  165.           'ȳ': FullValue := FullValue + 'Θ';
  166.           'ȴ': FullValue := FullValue + 'Ω';
  167.           'ȵ': FullValue := FullValue + 'δ';
  168.           'ȶ': FullValue := FullValue + '∞';
  169.           'ȷ': FullValue := FullValue + 'φ';
  170.           'ȸ': FullValue := FullValue + 'ε';
  171.           'ȹ': FullValue := FullValue + '∩';
  172.           'ɀ': FullValue := FullValue + '≡';
  173.           'Ɂ': FullValue := FullValue + '±';
  174.           'ɂ': FullValue := FullValue + '≥';
  175.           'Ƀ': FullValue := FullValue + '≤';
  176.           'Ʉ': FullValue := FullValue + '⌠';
  177.           'Ʌ': FullValue := FullValue + '⌡';
  178.           'Ɇ': FullValue := FullValue + '÷';
  179.           'ɇ': FullValue := FullValue + '≈';
  180.           'Ɉ': FullValue := FullValue + '°';
  181.           'ɉ': FullValue := FullValue + '∙';
  182.           'ɐ': FullValue := FullValue + '·';
  183.           'ɑ': FullValue := FullValue + '√';
  184.           'ɒ': FullValue := FullValue + 'ⁿ';
  185.           'ɓ': FullValue := FullValue + '²';
  186.           'ɔ': FullValue := FullValue + '■';
  187.           'ɕ': FullValue := FullValue + ' ';
  188.           '&#x%DF;': FullValue := FullValue + '▀';
  189.           '4': FullValue := FullValue + '"';
  190.           '–': FullValue := FullValue + '-';
  191.           '‘': FullValue := FullValue + '"';
  192.           '’': FullValue := FullValue + '"';
  193.           '“': FullValue := FullValue + '"';
  194.           '”': FullValue := FullValue + '"';
  195.           '„': FullValue := FullValue + '"';
  196.           else
  197.             FullValue := FullValue + CharCode;
  198.           end;
  199.         Counter := Counter + 7;
  200.       end;
  201.     until Counter > Length(Value);
  202.     HTMLDecode(FullValue);
  203.     Value := FullValue;
  204.     end
  205.   end;
  206.  
  207. procedure AnalyzePage(PostQuery: string);
  208.   var
  209.   Page: TStringList;
  210.   pozycja, startPos, endPos, ilosc, licznik: integer;
  211.   linia, adres, tytul: string;
  212.   
  213.   begin
  214.   licznik := 0;
  215.   Page := TStringList.Create;
  216.   PostPage('http://www.videoteka.com.pl/moduly/wyszukiwarka.php3','PHPSESSID=' +  PHPSESSID +'&str=19&tytul=qqqqqq&tytul_eng=&gatunek=&dystrybutor=&rezyser=&aktor=&rok=&polecamy='); //zainicjalizowanie PHPSESSID
  217.   PostPage('http://www.videoteka.com.pl/moduly/wyszukiwarka.php3',PostQuery); //zlecenie wyszukania
  218.   Page.Text := GetPage('http://www.videoteka.com.pl/index.php3?PHPSESSID=' + PHPSESSID + '&str=19&poz=1'); //Odwo│anie do wynik≤w
  219.   pozycja := FindLine('<b>Ilo╢µ: ', Page, 0);
  220.   if (pozycja >-1) then 
  221.    begin
  222.    linia := Page.GetString(pozycja);
  223.    startPos := pos('<b>Ilo╢µ: ', Linia);
  224.    delete(linia, 1, startPos + 9);
  225.    endPos := pos('</b>', Linia);
  226.    adres := copy(linia, 1, endPos - 1);
  227.    ilosc := StrToInt(adres, 0);
  228.    if ilosc > 0 then 
  229.     begin
  230.     PickTreeClear;
  231.     while ((ilosc > 0) and (pos('<a href="', Linia) > 0)) do
  232.      begin
  233.      startPos := pos('<a href="', Linia);
  234.      delete(linia, 1, startPos + 8);
  235.      endPos := pos('" title=', Linia);
  236.      adres := copy(linia, 1, endPos - 1);
  237.      adres := 'http://www.videoteka.com.pl' + adres + '&PHPSESSID=' + PHPSESSID;
  238.      startPos := pos('"Szczeg≤│owy opis filmu">', Linia);
  239.      delete(linia, 1, startPos + 24);
  240.      endPos := pos('</a>', Linia);
  241.      tytul := copy(linia, 1, endPos - 1);     
  242.      DecodeHTML(tytul);
  243.      PickTreeAdd(tytul, adres);
  244.      ilosc := ilosc - 1;
  245.      licznik := licznik + 1;
  246.      if (((licznik mod 20) = 0) and (ilosc > 0)) then
  247.       begin
  248.       Page.Text := GetPage('http://www.videoteka.com.pl//index.php3?str=19&poz=1&zakres=' + IntToStr(licznik) + '&nas=0&PHPSESSID=' + PHPSESSID);
  249.       pozycja := FindLine('<b>Ilo╢µ: ', Page, 0);
  250.       linia := Page.GetString(pozycja);
  251.       startPos := pos('<b>Ilo╢µ: ', Linia);
  252.       delete(linia, 1, startPos + 9);
  253.       end;
  254.      end;
  255.     end
  256.    else    
  257.     begin
  258.     DecodeHTML(MovieName);    
  259.     ShowMessage('Nie znaleziono ┐adnego filmu spe│niaj╣cego kryteria: "'+MovieName+'".');
  260.     end;
  261.    end
  262.   else
  263.     begin
  264.     DecodeHTML(MovieName);    
  265.     ShowMessage('Nie znaleziono ┐adnego filmu spe│niaj╣cego kryteria: "'+MovieName+'".');
  266.     end;
  267.    if PickTreeExec(adres) then
  268.     begin
  269.     Page.Text := GetPage(adres);
  270.     AnalyzeMoviePage(page);
  271.     end;
  272.   Page.Free;
  273.   end;
  274.  
  275. procedure AnalyzeMoviePage(Page: TStringList);
  276.   var
  277.   Linia, tytul, line, Obsada, OrgLine: string;
  278.   LineNr: Integer;
  279.   StartPos, EndPos, i: Integer;
  280.   nie: boolean;
  281.   begin
  282.  
  283.  pozycja := FindLine('Nowe wyszukiwanie', Page, 0);
  284.  linia := Page.GetString(pozycja);
  285.  startPos := pos('Nowe wyszukiwanie', Linia);
  286.  delete(linia, 1, startPos + 16);  
  287.   
  288.  //Foto
  289.  if (nocover = false) then
  290.   begin
  291.   startPos := pos('onclick="widok', Linia);
  292.   delete(linia, 1, startPos + 15);
  293.   endPos := pos(')"', Linia);
  294.   tytul := copy(linia, 1, endPos - 2);    
  295.   tytul := 'http://www.videoteka.com.pl/' + tytul;
  296.   tytul := URLEncode(tytul);
  297.   GetPicture(tytul, False);  
  298.   end;
  299.   
  300.   if (cover = false) then
  301.   begin
  302.   
  303.   // Tytu│ polski
  304.   startPos := pos('Tytu│:', Linia);
  305.   if startPos >0 then  
  306.    begin
  307.    delete(linia, 1, startPos + 5);
  308.    startPos := pos('<b>', Linia);
  309.    delete(linia, 1, startPos + 2);
  310.    endPos := pos('</b>', Linia);
  311.    tytul := copy(linia, 1, endPos - 1);     
  312.    DecodeHTML(tytul);
  313.    setField(fieldTranslatedTitle, tytul);
  314.    end
  315.  
  316.   // Tytu│ oryginalny
  317.   startPos := pos('Tytu│ oryginalny:</b>', Linia);
  318.   if startPos >0 then
  319.    begin
  320.    delete(linia, 1, startPos + 20);
  321.    startPos := pos('The ', linia);
  322.    if startPos > 0 then delete(linia, 1, startPos + 3);
  323.    endPos := pos('<br>', Linia);
  324.    tytul := copy(linia, 1, endPos - 1);    
  325.    if copy(tytul, 1, 1) = ' ' then delete(tytul, 1, 1);
  326.    end 
  327.   DecodeHTML(tytul);
  328.   setField(fieldOriginalTitle, tytul);
  329.  
  330.   // Gatunek
  331.   startPos := pos('Gatunek:</b>', Linia);
  332.   if startPos >0 then  
  333.    begin
  334.    delete(linia, 1, startPos + 11);
  335.    endPos := pos('<br>', Linia);
  336.    tytul := copy(linia, 1, endPos - 1);    
  337.    if copy(tytul, 1, 1) = ' ' then delete(tytul, 1, 1);
  338.    DecodeHTML(tytul);
  339.    tytul := AnsiUpFirstLetter(tytul);
  340.    setField(fieldCategory, tytul);
  341.   end;
  342.   
  343.   //Re┐yser
  344.   startPos := pos('Re┐yser:</b> <a href=', Linia);
  345.   if startPos >0 then  
  346.    begin
  347.    delete(linia, 1, startPos + 20);
  348.    startPos := pos('">', Linia);
  349.    delete(linia, 1, startPos + 1);  
  350.    startPos := pos('">', Linia);
  351.    delete(linia, 1, startPos + 1); 
  352.    endPos := pos('</', Linia);
  353.    tytul := copy(linia, 1, endPos - 1);    
  354.    if copy(tytul, 1, 1) = ' ' then delete(tytul, 1, 1);
  355.    DecodeHTML(tytul);
  356.    setField(fieldDirector, tytul);  
  357.   end;
  358.    
  359.   //Obsada
  360.   tytul := '';
  361.   startPos := pos('Obsada:</b>', Linia);
  362.   if startPos >0 then  
  363.    begin  
  364.    delete(linia, 1, startPos + 20);
  365.    while (pos('<a href=', Linia) < pos('Czas trwania:', Linia)) do
  366.     begin
  367.     startPos := pos('">', Linia);
  368.     delete(linia, 1, startPos + 1);  
  369.     startPos := pos('">', Linia);
  370.     delete(linia, 1, startPos + 1); 
  371.     endPos := pos('</', Linia);
  372.     tytul := tytul + ', ' + copy(linia, 1, endPos - 1);
  373.     end;
  374.    if copy(tytul, 1, 1) = ',' then delete(tytul, 1, 1);
  375.    if copy(tytul, 1, 1) = ' ' then delete(tytul, 1, 1);
  376.    DecodeHTML(tytul);
  377.    setField(fieldActors, tytul);  
  378.   end;
  379.   
  380.   // Czas trwania
  381.   startPos := pos('Czas trwania:</b>', Linia);
  382.   if startPos >0 then  
  383.    begin  
  384.    delete(linia, 1, startPos + 16);
  385.    endPos := pos(' min.', Linia);
  386.    tytul := copy(linia, 1, endPos - 1);    
  387.    if copy(tytul, 1, 1) = ' ' then delete(tytul, 1, 1);
  388.    DecodeHTML(tytul);
  389.    setField(fieldLength, tytul);
  390.   end;
  391.   
  392.   // Rok produkcji
  393.   startPos := pos('Rok produkcji:</b>', Linia);
  394.   if startPos >0 then  
  395.    begin
  396.    delete(linia, 1, startPos + 17);
  397.    endPos := pos('<br>', Linia);
  398.    tytul := copy(linia, 1, endPos - 1);    
  399.    if copy(tytul, 1, 1) = ' ' then delete(tytul, 1, 1);
  400.    DecodeHTML(tytul);
  401.    SetField(fieldYear, tytul);  
  402.   end;
  403.   
  404.   // Producent - tu jako dystrybucja
  405.   startPos := pos('Dystrybucja:</b> <a href=', Linia);
  406.   if startPos >0 then  
  407.    begin
  408.    delete(linia, 1, startPos + 24);
  409.    startPos := pos('">', Linia);
  410.    delete(linia, 1, startPos + 1);  
  411.    startPos := pos('">', Linia);
  412.    delete(linia, 1, startPos + 1); 
  413.    endPos := pos('</', Linia);
  414.    tytul := copy(linia, 1, endPos - 1);    
  415.    if copy(tytul, 1, 1) = ' ' then delete(tytul, 1, 1);
  416.    DecodeHTML(tytul);
  417.    setField(fieldProducer, tytul);    
  418.   end;
  419.   
  420.   //URL
  421.   startPos := pos('Strona filmu:</b> <a href="', Linia);
  422.   if startPos >0 then  
  423.    begin
  424.    if startPos > 0 then
  425.     begin
  426.     delete(linia, 1, startPos + 26);
  427.     endPos := pos('" ', linia);   
  428.     tytul := copy(linia, 1, endPos - 1);    
  429.     if copy(tytul, 1, 1) = ' ' then delete(tytul, 1, 1);
  430.     DecodeHTML(tytul);  
  431.     setField(fieldURL, tytul);
  432.     end;
  433.    end;
  434.     
  435.   // Opis filmu i recenzja
  436.   pozycja := FindLine('>Opis:<', Page, 0);
  437.   tytul := '';
  438.   repeat
  439.    begin
  440.    linia := Page.GetString(pozycja);
  441.    HTMLRemoveTags(linia);
  442.    DecodeHTML(linia);
  443.    while ((copy(linia, 1, 1) = '    ') or (copy(linia, 1, 1) = ' ') or (copy(linia, 1, 1) = 'á')) do delete(linia, 1, 1);
  444.    if (linia = '') then pozycja := pozycja +1;
  445.    end;
  446.   until (linia <> ''); 
  447.   pozycja2 := FindLine('Zobacz recenzjΩ', Page, 0);
  448.   if pozycja2 = -1 then
  449.    pozycja2 := FindLine('[Dodaj komentarz]', Page, 0);
  450.   repeat
  451.    begin
  452.    linia := Page.GetString(pozycja);
  453.    HTMLRemoveTags(linia);
  454.    DecodeHTML(linia);
  455.    endPos := pos('Opis:', linia);
  456.    if endPos <> 0 then delete(linia, 1, endPos + 4);
  457.    while ((copy(linia, 1, 1) = '    ') or (copy(linia, 1, 1) = ' ') or (copy(linia, 1, 1) = 'á')) do delete(linia, 1, 1);
  458.    while ((copy(linia, length(linia), 1) = '    ') or (copy(linia, length(linia), 1) = ' ') or (copy(linia, length(linia), 1) = 'á')) do delete(linia, length(linia), 1); 
  459.    if tytul = '' then
  460.     tytul := tytul + linia
  461.    else     
  462.     tytul := tytul + #13#10 + linia;
  463.    pozycja := pozycja + 1;
  464.    end;
  465.   until (pozycja >= pozycja2);
  466.   tytul := StringReplace(tytul, 'Zobacz stronΩ filmu', '');
  467.   tytul := StringReplace(tytul, 'Czas siΩ zalogawaµ...', '');
  468.   while ((copy(tytul, 1, 1) = '    ') or (copy(tytul, 1, 1) = ' ')) do delete(tytul, 1, 1);
  469.   while ((copy(tytul, length(tytul), 1) = '    ') or (copy(tytul, length(tytul), 1) = ' ')) do delete(tytul, length(tytul), 1);
  470.   endPos := pos('Zobacz', linia);
  471.   startPos := pos('stronΩ filmu', linia);    
  472.   if ((startPos > 0) and (endPos > 0)) then
  473.    begin
  474.    endPos := pos('" target=', linia);
  475.    startPos := pos('<a href="', linia);  
  476.    link := copy(linia, startPos + 9, endPos - startPos - 9);
  477.    setField(fieldURL, link);     
  478.    end
  479.   else
  480.    begin
  481.    linia := Page.GetString(pozycja);
  482.    endPos := pos('Zobacz', linia);
  483.    startPos := pos('stronΩ filmu', linia);    
  484.    if ((startPos > 0) and (endPos > 0)) then
  485.     begin
  486.     endPos := pos('" target=', linia);
  487.     startPos := pos('<a href="', linia);  
  488.     link := copy(linia, startPos + 9, endPos - startPos - 9);
  489.     setField(fieldURL, link);     
  490.     end
  491.    end;    
  492.   setField(fieldDescription, tytul);
  493.  
  494. end;
  495.  
  496.   DisplayResults;
  497.   end;
  498.  
  499. begin
  500.  Setarraylength(PHPsessidTablica,20);
  501.  PHPsessidTablica[0] := 'ae1f7cfed55558d90e6c60596e5e5069';
  502.  PHPsessidTablica[1] := 'ae1f7cfed55558d90e6c60596e5e5050';
  503.  PHPsessidTablica[2] := 'ae1f7cfed55558d90e6c60596e5e5051';
  504.  PHPsessidTablica[3] := 'ae1f7cfed55558d90e6c60596e5e5052';
  505.  PHPsessidTablica[4] := 'ae1f7cfed55558d90e6c60596e5e5053';
  506.  PHPsessidTablica[5] := 'ae1f7cfed55558d90e6c60596e5e5054';
  507.  PHPsessidTablica[6] := 'ae1f7cfed55558d90e6c60596e5e5055';
  508.  PHPsessidTablica[7] := 'ae1f7cfed55558d90e6c60596e5e5056';
  509.  PHPsessidTablica[8] := 'ae1f7cfed55558d90e6c60596e5e5057';
  510.  PHPsessidTablica[9] := 'ae1f7cfed55558d90e6c60596e5e5058';
  511.  PHPsessidTablica[10] := 'ae1f7cfed55558d90e6c60596e5e5059';
  512.  PHPsessidTablica[11] := 'ae1f7cfed55558d90e6c60596e5e5060';
  513.  PHPsessidTablica[12] := 'ae1f7cfed55558d90e6c60596e5e5061';
  514.  PHPsessidTablica[13] := 'ae1f7cfed55558d90e6c60596e5e5062';
  515.  PHPsessidTablica[14] := 'ae1f7cfed55558d90e6c60596e5e5063';
  516.  PHPsessidTablica[15] := 'ae1f7cfed55558d90e6c60596e5e5064';
  517.  PHPsessidTablica[16] := 'ae1f7cfed55558d90e6c60596e5e5065';
  518.  PHPsessidTablica[17] := 'ae1f7cfed55558d90e6c60596e5e5066';
  519.  PHPsessidTablica[18] := 'ae1f7cfed55558d90e6c60596e5e5067';
  520.  PHPsessidTablica[19] := 'ae1f7cfed55558d90e6c60596e5e5068';
  521.   if CheckVersion(3,4,3) then
  522.     begin
  523.     MovieName := GetField(fieldTranslatedTitle);
  524.     jakitytul:=true;
  525.     if MovieName = '' then
  526.       begin
  527.       MovieName := GetField(fieldOriginalTitle);
  528.       if MovieName <> '' then jakitytul:=false;
  529.       end    
  530.     if Input('Casablanca Import', 'Podaj tytu│ filmu:', MovieName) then
  531.       begin
  532.       // Zamiana na ISO-8859-2
  533.       MovieName:=StringReplace(MovieName, '╣', chr(177));
  534.       MovieName:=StringReplace(MovieName, 'µ', chr(230));
  535.       MovieName:=StringReplace(MovieName, 'Ω', chr(234));
  536.       MovieName:=StringReplace(MovieName, '│', chr(179));
  537.       MovieName:=StringReplace(MovieName, '±', chr(241));
  538.       MovieName:=StringReplace(MovieName, '≤', chr(243));
  539.       MovieName:=StringReplace(MovieName, '£', chr(182));
  540.       MovieName:=StringReplace(MovieName, 'ƒ', chr(188));
  541.       MovieName:=StringReplace(MovieName, '┐', chr(191));
  542.       MovieName:=StringReplace(MovieName, 'Ñ', chr(161));
  543.       MovieName:=StringReplace(MovieName, '╞', chr(198));
  544.       MovieName:=StringReplace(MovieName, '╩', chr(202));
  545.       MovieName:=StringReplace(MovieName, 'ú', chr(163));
  546.       MovieName:=StringReplace(MovieName, '╤', chr(209));
  547.       MovieName:=StringReplace(MovieName, '╙', chr(211));
  548.       MovieName:=StringReplace(MovieName, 'î', chr(166));
  549.       MovieName:=StringReplace(MovieName, 'Å', chr(172));
  550.       MovieName:=StringReplace(MovieName, '»', chr(175));
  551.       pozycja := length(MovieName);
  552.       while pozycja > 20 do pozycja := pozycja - 20;
  553.       PHPSESSID:=PHPsessidTablica[pozycja];
  554.       pozycja := pos('/pl/', MovieName);
  555.       if  pozycja > 0 then
  556.        begin
  557.        MovieName := StringReplace(MovieName, '/pl/' , '');
  558.        jakitytul := true;
  559.        end;      
  560.       pozycja := pos('/eng/', MovieName); 
  561.       if pozycja > 0 then
  562.        begin
  563.        MovieName := StringReplace(MovieName, '/eng/' , '');
  564.        jakitytul := false;
  565.        end;     
  566.        pozycja := pos('/cover/', MovieName); 
  567.       if pozycja > 0 then
  568.        begin
  569.        MovieName := StringReplace(MovieName, '/cover/' , '');
  570.        cover := true;
  571.        end    
  572.       else cover := false;    
  573.       pozycja := pos('/nocover/', MovieName); 
  574.       if pozycja > 0 then
  575.        begin
  576.        MovieName := StringReplace(MovieName, '/nocover/' , '');
  577.        nocover := true;
  578.        end    
  579.       else nocover := false;      
  580.       while (copy(MovieName, length(MovieName), 1) = ' ') do delete(MovieName, length(MovieName), 1); 
  581.       while (copy(MovieName, 1, 1) = ' ') do delete(MovieName, 1, 1); 
  582.       if(jakitytul=true) then
  583.        begin
  584.        AnalyzePage('PHPSESSID=' + PHPSESSID + '&str=19&tytul=' + MovieName + '&tytul_eng=&gatunek=&dystrybutor=&rezyser=&aktor=&rok=&polecamy=');
  585.        end;
  586.       if(jakitytul=false) then
  587.        begin
  588.        AnalyzePage('PHPSESSID=' + PHPSESSID + '&str=19&tytul=&tytul_eng=' + MovieName + '&gatunek=&dystrybutor=&rezyser=&aktor=&rok=&polecamy=');
  589.        end;
  590.       end;
  591.     end
  592.   else
  593.     ShowMessage('Skrypt wymaga programu Ant Movie Catalog w wersji 3.4.3 lub nowszej');
  594. end.